
Partial Class Planet
    Inherits UserPage

    Private planetId As String

    Protected Sub ObjectDataSource1_ObjectCreating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceEventArgs) Handles ObjectDataSource1.ObjectCreating

        e.ObjectInstance = Master.Empire

    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        planetId = Request.QueryString("cp")
        If planetId Is Nothing Then
            Response.Redirect(SiteMap.EMPIRE_PAGE)
        End If
    End Sub

    Protected Sub btnBeginRefresh_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnBeginRefresh.Click

        Dim planet As OGame.Planet = Master.Empire.GetPlanet(planetId)
        planet.BeginLoadOverviewPage()
        planet.BeginLoadOtherPages()

    End Sub

    Protected Sub ObjectDataSource2_ObjectCreating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceEventArgs) Handles ObjectDataSource2.ObjectCreating

        e.ObjectInstance = Master.Empire.GetPlanetView(planetId)

    End Sub
End Class
